import axios from 'axios'
// import store from '@/shared/store'
import { time } from "@/shared/utils/date.js";
import { myUuid } from "@/shared/utils/uuid.js";
import store from 'store-gem.js';

var myStore = new store(localStorage)

let _this = this
// post
export function postService(option){
  return new Promise((resolve,reject) => {
    // 创建axios实例
    const instance = axios.create({
      baseURL: 'https://www.haiminet.com/',
      timeout: 20000,
      headers:{ 
        'Content-Type':'application/json',
        'r_i':'RE'+time+myUuid,
        'p_u':myStore.get('user_info') ? myStore.get('user_info').uid : '',
        'p_s':myStore.get('user_info') ? myStore.get('user_info').sessionId :''
        // 'p_u':'US20180626143611801f7306ea63c5345a',
        // 'p_s':'SE20180627214441558d541dd179a00406'
      }
    });
    instance(option).then(response => {
      resolve(response);
    }).catch(error => {
      reject(error);
    })
  })
}



